Used to sum two numbers or concatenate two String values.
Notes
Syntax
The + operator has two syntaxes:
result=expression1 + expression2
Part | Type | Description |
|---|---|---|
result |
Number |
The sum of expression1 and expression2. |
expression1 |
Number |
Any numeric expression. |
expression2 |
Number |
Any numeric expression. |
result=expression1 + expression2
Part | Type | Description |
|---|---|---|
result |
The concatenation of expression1 and expression2. |
|
expression1 |
Any string expression. |
|
expression2 |
Any string expression. |
You can use Operator_Add to define the + operator for custom classes.
Examples
This example adds several numbers together:
This example concatenates two strings and stores the result in a variable:
See Also
Operator_Add, Str, Val functions.